package com.du.demo.utils;

public class BaseResult {

    private String code;

    private String msg;

    private Object data;

    public static BaseResult success(){
        BaseResult result = new BaseResult();
        result.setCode("200");
        result.setMsg("请求成功");
        return result;

    }

    public static BaseResult success(Object data){

        BaseResult result = success();
        result.setData(data);
        return result;
    }

    public static BaseResult error(String code,String msg){
        BaseResult baseResult = new BaseResult();
        baseResult.setCode(code);
        baseResult.setMsg(msg);
        return baseResult;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
